import React, {useEffect, useState} from 'react';
import {getBlogTypeListAllApi} from "../api/publicApi";

const UseGetBlogType = () => {
    const [data, setData] = useState([])

    useEffect(() => {
        getBlogTypeListAllApi().then(res => {
            if (res.code === '200') {
                setData(res.data.rows)
            }
        }).catch(e => {
                console.log(e)
            }
        )

    }, [])
    return data
}

export default UseGetBlogType;
